/*jshint esversion: 6 */
import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes=[
  {
    name:'tips',
    path:'/',
    component:()=>import('../views/tips')
  },
  {
    name:'home',
    path:'/home',
    component:()=>import('../views/home')
  },
  // {
  //   name:'tips',
  //   path:'/tips',
  //   component:()=>import('../views/tips')
  // },
  {
    name:'single',
    path:'/single',
    component:()=>import('../views/single')
  },
  {
    name:'singleResult',
    path:'/singleResult',
    component:()=>import('../views/singleResult')
  },
  {
    name:'loves',
    path:'/loves',
    component:()=>import('../views/loves')
  },
  {
    name:'lovesResult',
    path:'/lovesResult',
    component:()=>import('../views/lovesResult')
  },
  {
    name:'couple',
    path:'/couple',
    component:()=>import('../views/couple')
  },
  {
    name:'coupleResult',
    path:'/coupleResult',
    component:()=>import('../views/coupleResult')
  },
  {
    name:'redLetter',
    path:'/redLetter',
    component:()=>import('../views/redLetter')
  },
  {
    name:'redLetterResult',
    path:'/redLetterResult',
    component:()=>import('../views/redLetterResult')
  }
]

const router = new VueRouter({
  routes
});

// router.beforeEach((to,from,next)=>{
//   if(window.localStorage.getItem('agreeRules')==='1'||to.name==='tips'){
//     next();
//   } else {
//     next({
//       name:'tips'
//     });
//   }
// });


export default router;
